package summit;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author summit
 * @since 2021/12/15 11:07
 */
@SpringBootApplication
@RestController
public class Log4jApplication {

	public static final Logger logger = LogManager.getLogger(Log4jApplication.class);

	public static void main(String[] args) {
		SpringApplication.run(Log4jApplication.class, args);
	}

	@GetMapping("/log4j")
	public String test(@RequestParam String name) {
		logger.info("打印=> {}", name);

		return "success";
	}
}
